1. Field of the Invention
The present invention relates to a method and network device for loop detection, and in particular to a method and network device for determining whether a loop is occurred in the network by using a loop detection frame.
2. Description of the Related Art
Ethernet network is a common local area network (LAN) technology. In a large-scale local area network, a loop may be formed between two or more bridges, such as switches. A packet may be transmitted repeatedly or flooded within the loop, not only occupying the bandwidth of the network and consuming the resources of the network device, such as memory resources, but also deteriorating the efficiency of the network and the operation effect of the device.
Referring to FIG. 1A and FIG. 1B, two kinds of loops formed in the LAN are shown respectively. In FIG. 1A, the packet 14 transmitted from a port 101 of a device 10 may be sent back by a device 12 via a switch (not shown in FIG. 1), hence forming a loop. In FIG. 1B, the packet 14 transmitted from a port 101 of a device 10 may be sent to another port 102 by a device 12 via a switch (not shown in FIG. 1), hence forming a loop.
Currently, the Spanning Tree Protocol (STP) is used primarily to resolve problems caused by the loop according to IEEE 802.1. When a loop is occurred, some links on the loop will be cut off by disabling port(s) of the switch, so as to break the loop. However, it is costlier to support the spanning tree protocol by hardware. If the spanning tree protocol is supported by software, then the computing unit of the device or the switch demands higher program computing capability. However, some devices or switches merely configure an Application Specified Integrated Circuit (ASIC) which has no program computing capability to handle the packet, so the Spanning Tree Protocol is incomplete for all kinds of devices or switches.